/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ccedeno
 */
@Entity
@Table(name = "det_acc_mov", catalog = "emilima_tradoc", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetAccMov.findAll", query = "SELECT d FROM DetAccMov d"),
    @NamedQuery(name = "DetAccMov.findByIdDetAccMov", query = "SELECT d FROM DetAccMov d WHERE d.idDetAccMov = :idDetAccMov")})
public class DetAccMov implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_det_acc_mov", nullable = false)
    private Integer idDetAccMov;
    @JoinColumn(name = "fk_mov_exp", referencedColumnName = "id_mov_exp", nullable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private MovExp movExp;
    @JoinColumn(name = "fk_acc_doc", referencedColumnName = "id_acc_doc", nullable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private AccDoc accDoc;

    public DetAccMov() {
    }

    public DetAccMov(Integer idDetAccMov) {
        this.idDetAccMov = idDetAccMov;
    }

    public Integer getIdDetAccMov() {
        return idDetAccMov;
    }

    public void setIdDetAccMov(Integer idDetAccMov) {
        this.idDetAccMov = idDetAccMov;
    }

    public MovExp getMovExp() {
        return movExp;
    }

    public void setMovExp(MovExp movExp) {
        this.movExp = movExp;
    }

    public AccDoc getAccDoc() {
        return accDoc;
    }

    public void setAccDoc(AccDoc accDoc) {
        this.accDoc = accDoc;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetAccMov != null ? idDetAccMov.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetAccMov)) {
            return false;
        }
        DetAccMov other = (DetAccMov) object;
        if ((this.idDetAccMov == null && other.idDetAccMov != null) || (this.idDetAccMov != null && !this.idDetAccMov.equals(other.idDetAccMov))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.DetAccMov[ idDetAccMov=" + idDetAccMov + " ]";
    }
}
